/**
 * Created by fusy on 2016/7/5.
 */
import React from 'react';
import util from 'util';
import {message} from 'antd';
import InputPanel from "./component/inputPanel";

class Parameter extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            rowsData: []
        };
    }

    componentDidMount() {
        // 获取大模块
        util.httpRequest({
            type: "POST", url: 'param010201.json', params: {groupparaid:'ROOT'}, success: function (result) {
                if (result.ret_code === "0000") {
                    let result1 = result.rows;
                    let list = [];
                    result1.forEach((value1, index) => {
                        let rows = [];
                        list.push(<InputPanel key={"InputPanel" + index}
                                              index={index}
                                              paraid={value1.paraid}
                                              header={value1.paraname} {...value1}

                                    ></InputPanel>);
                    });
                    this.setState({
                        rowsData: list
                    });
                }
            }.bind(this)
        });
    }

    render() {
        return (
            <div>
                {this.state.rowsData}
            </div>)
    }
}
export default Parameter;